﻿/* 
 * TABLE: WikiPages 
 */

CREATE TABLE WikiPages(
    PageId          int              IDENTITY(1,1),
    CategoryId      int              NOT NULL,
    PublicUrl       nvarchar(256)    NOT NULL,
    Content         nvarchar(max)    NOT NULL,
    Name            nvarchar(256)    NOT NULL,
    CreationDate    datetime2(0)     NOT NULL,
    CONSTRAINT PK_WikiPages PRIMARY KEY NONCLUSTERED (PageId)
)
GO
/* 
 * TABLE: WikiPages 
 */

ALTER TABLE WikiPages ADD CONSTRAINT FK_WikiCategoriesWikiPages 
    FOREIGN KEY (CategoryId)
    REFERENCES WikiCategories(CategoryId)